package com.cws.job;


import java.util.Map;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.cws.model.SysJob;

public class Test implements Job{

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		
		Map<String, Object> dataMap = context.getJobDetail().getJobDataMap();

		SysJob job = (SysJob)dataMap.get("jobObj");
		//System.out.println(job.getStr("targetId"));
		
		job.set("lastExecTime", context.getFireTime()).set("nextExecTime", context.getNextFireTime()).update();
		
//        System.out.println("Previous Fire Time: " + context.getPreviousFireTime());  
//        System.out.println("Current Fire Time: " + context.getFireTime());  
//        System.out.println("Next Fire Time: " + context.getNextFireTime());  
        
		//System.out.println("任务执行啦");
	}

}
